package cn.edu.lsnu.mbti.controller;

import cn.edu.lsnu.mbti.common.R;
import cn.edu.lsnu.mbti.entity.vo.PageVo;
import cn.edu.lsnu.mbti.service.PageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("page")
@Slf4j
public class PageController {

    @Resource
    private PageService pageService;


    /**
     * 保存用户在页面停留的时长和点击次数
     * @param pageVo
     */
    @PostMapping("savePage")
    public R<String> savePage(@RequestBody PageVo pageVo){
        return R.success(pageService.savePage(pageVo));
    }
}
